package ui.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

import base.BaseFra;

/**
 * Created by chenjian on 16/8/29
 */
public class FragAdp extends FragmentPagerAdapter {
    private List<String> titles;
    private List<BaseFra> fragments;
    private int flag;
    private FragmentManager fm;

    public FragAdp(FragmentManager fm, List<String> titles, List<BaseFra> fragments) {
        super(fm);
        this.fm=fm;
        this.titles=titles;
        this.fragments=fragments;
        this.flag=flag;
    }

    @Override
    public int getCount() {
        return titles.size();
    }

    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return titles.get(position);
    }
}
